Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test groups for equality before doing fontMath kerning math #245

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

benkiel
Copy link
Member

@benkiel benkiel commented Jun 23, 2021

This fixes #22, but will be breaking to a lot of code (though it's more correct). Perhaps better to add a strict option?

@benkiel
Copy link
Member Author

benkiel commented Jun 23, 2021

@behdad @typesupply

@codecov
Copy link

codecov bot commented Jun 23, 2021

Codecov Report

Merging #245 (4852acf) into master (2da8061) will increase coverage by 0.10%.
The diff coverage is 97.22%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #245      +/-   ##
==========================================
+ Coverage   88.46%   88.57%   +0.10%     
==========================================
  Files          13       13              
  Lines        2359     2390      +31     
  Branches      305      307       +2     
==========================================
+ Hits         2087     2117      +30     
  Misses        195      195              
- Partials       77       78       +1     
Flag Coverage Δ
unittests 88.57% <97.22%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
Lib/fontMath/mathKerning.py 90.69% <85.71%> (-0.30%) ⬇️
Lib/fontMath/test/test_mathKerning.py 99.06% <100.00%> (+0.13%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2da8061...4852acf. Read the comment docs.

@typesupply
Copy link
Member

I'm on a deadline now, so this will take me at least a few days to review. The non-equal groups was a feature, not a bug, but I'll have to try to remember why I did it the way that I did. I wrote this particular bit of code around 2003 and all that I remember off the top of my head is that it was very difficult. 😟

@benkiel
Copy link
Member Author

benkiel commented Jun 23, 2021

I think that this may be better with a strict option, so one can decide what they want, the default set to False, will re-work. No rush on this at all, the issue has been sitting a long time.

@behdad
Copy link
Contributor

behdad commented Jun 23, 2021

Thanks Ben. I see Tal's comment about this being intentional.

If, say, group1 has a particular glyph A in a group, but other side doesn't have A in any group, one might want to assume that it was an omission in group2 and hence add it anyway? I find that dubious.

The alternative is to split the groups when mismatches occur. We have code to do that in fontTools.misc.classifyTools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mathKerning is wrong in many ways
3 participants